2. Managing SharePoint Services
After you have run the
SharePoint 2010 Products Configuration Wizard to install SharePoint on
your servers, you can use the SharePoint 2010 Central Administration
website to launch the Farm Configuration Wizard. Although it will get
you up and running very quickly, it might not configure your farm as
you want; for example, the database names it creates will be in the
format name_GUID, where GUID
is a randomly generated, globally unique identifier. Also, the farm
wizard uses the account entered as the Application Pool Identity for
the default content Web application and starts the Web Analytics
Service by default—both of which may not be desirable on a production
farm.
Using the wizard may be
sufficient if you want to create a quick prototype or perhaps if you
are using SharePoint in a developer environment. However, if any of
those environments are limited in their CPU power or in the amount of
memory they have, the farm wizard may not be suitable either. For
example, the Web Analytics Service uses a large amount of CPU, so your
developers might be interested in stopping that service. There are
other services that they might want to start and stop on a regular
basis, especially if they are using their computers as their day-to-day
desktop connections, where they read e-mails and complete
documentations, as well as to run SharePoint for development or
prototyping.
You can use tools such as the
Central Administration website to manage the configuration; however,
you may forget to execute all the tasks necessary to complete a
configuration change. Instead, you can use Windows PowerShell scripts,
which—after you have tested them to make sure that you have not
forgotten any tasks—should make managing configuration changes more
reliable and error free. You should store these scripts in a central
location after they are developed, to make them convenient for fellow
administrators to use and incorporate in their environments. Your
developer may also thank you for developing these scripts. Such
automated tasks might include the following items.
To quickly delete a specific Web application, type
Get-SPWebApplication http://teams | Remove-SPWebApplication -Confirm
To remove the Web application, the IIS website, and all the associated databases, type
Remove-SPWebApplication http://teams -Confirm -DeleteIISSite '
-RemoveContentDatabases
If you do not run the Farm
Configuration Wizard, you might find that you need a service that you
originally thought you would not need. For example, if no application services are started, and then you try to use one of
the SharePoint 2010 workflows, the Microsoft Visio diagram of the
workflow progress will not be displayed. However, to solve this
problem, you must do more than just create the Visio Application
Service. There are other dependencies involved, one of which is the
State Service Application. The state services can only be created in
the Central Administration site, by using the farm wizard—something you
will want to avoid as an administrator. To create the state service
using Windows PowerShell, type the following commands.
PS: C:\Users\Peter>New-SPStateServiceDatabase -Name Contoso_StateService_DB |
>>New-SPStateServiceApplication -Name Contoso_StateService |
>>New-SPStateServiceApplicationProxy -Name Contoso_StateService_Proxy -Default
>><ENTER>
Note:
This command may not work in
your environment if the associated service instance is not running. For
a more comprehensive script, see “SP+PS 2010: PowerShell to Create a
Service Application” at http://sharepoint.microsoft.com/blogs/zach/Lists/Posts/Post.aspx?ID=50.
Each service application is slightly different. For example, not all service applications require a database.However, each service will
require a service application proxy, which connects a Web application
to the service application.